package com.hcy.performancepro.po.performanceTool;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@TableName("record_entity")
public class RecordEntity {

    /**
     * id 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * requestId 请求id
     */
    @TableField("request_id")
    private String requestId;

    /**
     * timestamp 时间戳
     */
    @TableField("timestamp")
    private Long timestamp;

    /**
     * user 用户信息
     */
    @TableField("user")
    private Object user;

    /**
     * ipAddress 访问ip
     */
    @TableField("ip_address")
    private String ipAddress;

    /**
     * totalCostTime 消耗时间（毫秒）
     */
    @TableField("total_cost_time")
    private Long totalCostTime;

    /**
     * createTime 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
